<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>

  <meta http-equiv="content-type" content="text/html;charset=UTF-8"><title>RedRover Requirements</title>
  
  <style>
    h1 { font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; font-size: 22px; font-weight: bold; }
  div.writeboardbody { font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; font-size: 14px; line-height: 19px; color: #000; }
  div.writeboardbody h1 { font-size: 130%; }
  div.writeboardbody h2 { font-size: 100%; }
  div.writeboardbody h3 { font-size: 100%; }
  table { 
    background-color:#FFFFFF;
    border: solid #000 3px;
  }
  table td {
    padding: 5px;
    border: solid #000 1px;
  }
  </style></head><body bgcolor="#ffffff">
  
  <h1>RedRover newspaper Project</h1>
  
  <p>
  Kate Chatfield-Reed<br />
  Camilo Lòpez Dìaz<br />
  Edward Ocampo-Gooding<br />
  </p>
  <hr />
  <h2>Introduction</h2>
  <p>
   RedRover is a on-line newspaper tool that will provide an easy to use web interface 
   to the editor, and a web interface to the reader.

  </p>
  <p>
  RedRover is being development using the Ruby On Rails (RoR) framework.
  </p>
<h2>Requirements</h2>

<p>Based on the experience of Sam Solomon, editor of <em>The Campus</em> and our own experience as newspaper readers, we initially had three actors in mind: the Reader, Writer and Editor. However, after meeting with Mr. Solomon, we determined that the Writer and Editor should really be subsumed into one role, which we decided would be the Editor.</p>

<h3>Reader Requirements</h3>

<div class="writeboardbody">
  <table>
		<tbody><tr>
			<td> Name </td>
			<td> UC-1: Read articles</td>
		</tr>
		<tr>
			<td> Summary </td>
			<td> Articles are displayed by section and made available for the user to read </td>
		</tr>
		<tr>
			<td> Rationale </td>
			<td> The user needs an interface that allows him to read the articles </td>
		</tr>
		<tr>
			<td> Users </td>
			<td> Reader </td>
		</tr>
		<tr>
			<td> Preconditions </td>
			<td> The reader's web browser must be at the newspaper site </td>
		</tr>
		<tr>
			<td> Basic Course of Events </td>
			<td> <ol><br><li> The reader selects an article from the page</li><br><li> The article selected is displayed</li> </ol></td>
		</tr>
		<tr>
			<td> Alternative Paths </td>
			<td> 
	<ol>
	<li>The reader could choose to search for the article using the searching option instead </li>
		<li>The reader could change sections before selecting an article </li></ol></td>
		</tr>
		<tr>
			<td> Postconditions </td>
			<td> The article selected is displayed on the page for the reader </td>
		</tr>
	</tbody></table>
<br/><br/>
	<table>
		<tbody><tr>
			<td> Name </td>
			<td> UC-2: Search articles</td>
		</tr>
		<tr>
			<td> Summary </td>
			<td>
The user can enter words or phrases that she wishes to locate in the title, date, author, section, or subject of the article. The articles that match the search are displayed. </td>
		</tr>
		<tr>
			<td> Rationale </td>
			<td>
The user may want to find articles in a way that does not match how the
articles are organized in the page layout. The search option allows the
user to quickly locate articles she may have otherwise spent a long
time searching for. </td>
		</tr>
		<tr>
			<td> Users </td>
			<td> Reader </td>
		</tr>
		<tr>
			<td> Preconditions </td>
			<td> The readers web browser must be at the newspaper site </td>
		</tr>
		<tr>
			<td> Basic Course of Events </td>
			<td> <ul><br><li> The reader goes to the search page / selects the text window labelled search</li><br><li> The reader enters the word or phrase that she wishes to locate</li><br><li> The reader selects where she wants to search; title, date, author, section, or subject</li><br><li> The reader selects “Search”</li><br><li> The articles that match that search are displayed</li><br><li> The reader selects the article she wants to read </li><br></ul></td>
		</tr>
		<tr>
			<td> Alternative Paths </td>
			<td> 
	<ol>
	<li>The reader can choose to stop searching and switch to another page of the site at any time </li></ol></td>
		</tr>
		<tr>
			<td> Postconditions </td>
			<td> The article selected is displayed on the page for the reader </td>
		</tr>
	</tbody></table>
	


	<ul>
	<li>Read access to all articles</li>
		<li>Have a clear layout of articles by section</li>
		<li>Easy navigation between sections and articles</li>
		<li>Ability to search based on; title, date, author, section, and subject</li>
		<li>Ability to read the first part of the article before choosing to read the rest</li>
	</ul>
</div>



<h3>Editor Requirements</h3>

<div class="writeboardbody">
  <table border="1">
    <tbody><tr>
      <td> Name </td>
      <td> UC-1: Write articles</td>
    </tr>
    <tr>
      <td> Summary </td>
      <td> Writing a new article </td>
    </tr>
    <tr>
      <td> Rationale </td>
      <td> Articles must be writen in order to be published in the newspaper; this is the real content of the newspaper </td>
    </tr>
    <tr>
      <td> Users </td>
      <td> Editor </td>
    </tr>
    <tr>
      <td> Preconditions </td>
      <td>
(if we decide to have some login in system) the editor must be signed up and log in in order to write a new article, or at least must identify themselves </td>
    </tr>
    <tr>
      <td> Basic Course of Events 
</td>
      <td> 
  <ol>
    <li>An article entry form is shown </li>
    <li>The editor enters the article content, along with attached article meta-content, like the author's name, the article title, and a blurb that may appear in places where the full article content is not what is wanted to be shown.</li>
    <li>The editor tries to submit the article </li>
    <li>The system validates the submission (no empty title or body text, correctness of the formating syntax, no broken image links, etc.) The validation is flexible and based on a set of configurable rules.</li>
    <li>On submission, the article is stored in the pool of articles to be later chosen for a certain issue. </li></ol></td>
    </tr>
    <tr>
      <td> Alternative Paths </td>
      <td>If the article does not pass the validation test, the editor is asked to correct it in order to fit the required conditions </td>
    </tr>
    <tr>
      <td> Postconditions </td>
      <td> A new valid article is added to the pool of articles </td>
    </tr>
  </tbody></table>
  
  <p><strong>Note</strong>: It is important to define the <em>validation</em> <em>test</em>.</p>

  <table>
    <tbody><tr>
      <td> Name </td>
      <td> UC-2: Article Pool </td>
    </tr>
    <tr>
      <td> Summary </td>
      <td>
      When an article is entered into the database, it effectively enters the "article pool", where an editor can choose a set of articles to be associated (put in) a section in an issue. Additionally, when an article is entered into the database, it is initially marked as "not edited yet". This state can later be changed to others like "rejected" or "copywriten". By allowing articles to be ordered by a category like "most recent" and separating them into sub-pools of the three beforementioned statuses, an editor could work in an established waterfall editing workflow: they edit a piece, determine if it's good or not, and associate it with a section in an issue.</td>
    </tr>
    <tr>
      <td> Rationale </td>
      <td> Editors want to associate (insert) articles with sections in issues, and would like to have that as the final part of an editing workflow. </td>
    </tr>
    <tr>
      <td> Users </td>
      <td> editor </td>
    </tr>
    <tr>
      <td> Preconditions </td>
      <td> There must be previously entered articles.</td>
    </tr>
    <tr>
      <td> Basic Course of Events </td>
      <td> 
  <ol>
    <li>Articles from a given pool are shown</li>
    <li>The editor selects an article</li>
    <li>The article is edited and has its status changed</li>
  </ol></td>
    </tr>
    <tr>
      <td> Alternative Paths </td>
      <td> The article could be associated with a section in an issue. </td>
    </tr>
    <tr>
      <td> Postconditions </td>
      <td> The article has been edited, could have its status changed, and could be associated with a section in an issue. </td>
    </tr>
  </tbody></table>
  
  <p><strong>Question</strong> : What possible status can the article be in ?</p>


  <table>
    <tbody><tr>
      <td> Name </td>
      <td> UC-3: Uploading a picture </td>
    </tr>
    <tr>
      <td> Summary </td>
      <td> When a editor needs a picture in an article, this must be pre-stored in a picture bank </td>
    </tr>
    <tr>
      <td> Rationale </td>
      <td>Pictures are often needed within articles </td>
    </tr>
    <tr>
      <td> Users </td>
      <td> Editor </td>
    </tr>
    <tr>
      <td> Preconditions </td>
      <td> The user must be identified in the system </td>
    </tr>
    <tr>
      <td> Basic Course of Events </td>
      <td> 
  <ol>
  <li>A form to upload the picture is shown</li>
    <li>The user fills in the form (a url to upload a picture from)</li>
    <li>The system validates this form </li>
    <li>The system tries to get the meta-data information from the picture</li>
    <li>The picture is stored </li></ol></td>
    </tr>
    <tr>
      <td> Alternative Paths </td>
      <td> If the form information was invalid a form showing the mistakes or missing information must be shown. If the system can not acces the meta-data, the user is warned.</td>
    </tr>
    <tr>
      <td> Postconditions </td>
      <td> A picture and its meta-data is stored.  </td>
    </tr>
  </tbody></table>

  <table>
    <tbody><tr>
      <td> Name </td>
      <td> UC-4: Ad management </td>
    </tr>
    <tr>
      <td> Summary </td>
      <td> An editor can upload ads and place them in configurable advertisement regions in a certain section in a certain issue. </td>
    </tr>
    <tr>
      <td> Rationale </td>
      <td>Ads are required for revenue </td>
    </tr>
    <tr>
      <td> Users </td>
      <td> Editor </td>
    </tr>
    <tr>
      <td> Preconditions </td>
      <td> The user must be identified in the system </td>
    </tr>
    <tr>
      <td> Basic Course of Events </td>
      <td> 
  <ol>
  <li>A form to upload the ad is shown</li>
    <li>The user fills in the form (a url to upload an ad from)</li>
    <li>The system validates this form </li>
    <li>The system associates the ad with an advertisement region in a section in an issue, and begins displaying it as such.</li>
  </ol></td>
    </tr>
    <tr>
      <td> Alternative Paths </td>
      <td> If the ad is already present in the collection of already uploaded ads, the user can skip the uploading step and associate the ad with an advertisement region.</td>
    </tr>
    <tr>
      <td> Postconditions </td>
      <td> An ad is stored and associated with an ad-space.  </td>
    </tr>
  </tbody></table>
</div>

<h2>Top level design</h2>
<h3>MVC</h3>
<p>
In order to mantain good software creation practices in a web application it is imporant to separate structure from presentation. A very succesful architecture that have reached this goal is the Model-View-Controller (MVC) idea. In MVC, the models hold the data and know how to manipulate it. The controllers respond to events from the outside, and the views render the information properly
to the user. 

</p>
<h3>Why Rails?</h3>
<p>
Ruby on Rails is a web framework that relays on the MVC architecture, is well known due to enforce the use of good practices to the programers, and is written in Ruby, a purely object oriented language.
</p>
<h3>Classes</h3>
<p>To store data, we use a regular SQL database supported by RoR (e.g., MySQL or PostgreSQL), but instead of directly querying the SQL server, we use RoR's ActiveRecord infrastructure, which maps database tables to Ruby objects and provides built-in methods for common CRUD (Create/Retrieve/Update/Delete) tasks.
</p>
<p>
A newspaper as a whole is structured as having (in an atomic to more complex class progression) articles, sections, issues, and volumes.
</p>
<h4>Article</h4>
<p>
An article consists of a writer's content (usually a news story) and possibly some images. It also has an author name, a date, a title, and a blurb (usually the first few lines to an article---this kind of thing is shown on index or home pages). An Article belongs to a section.
</p>
<h4>Section</h4>
<p>
A section represents a class of articles, having similar content material or sharing a theme (Sports, Entertainment, etc.). A Section has many articles and belongs to an issue.
</p>
<h4>Issue</h4>
<p>
An issue is a particular issue of a newspaper (analogous to an entire paper copy). An issue has many sections, and belongs to a volume.
</p>
<h4>Volume</h4>
<p>
A volume is the set of all the different newspapers published in a period of time (normally a year). A volume has many issues.
</p>
<img src = "images/class_diagram.png" alt= "Class Diagram for RedRover">
</body></html>
